package com.sfac.javaSpringBoot.modules.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

public class Result<T> {
    private int status;
    private String message;
    private T object;

    public int getStatus() {
        return status;
    }

    public Result() {
    }
     

    public Result(int status, String message, T object) {
        this.status = status;
        this.message = message;
        this.object = object;
    }

    public Result(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }
    //枚举，
    @JsonFormat(shape= JsonFormat.Shape.OBJECT)
    public enum ResultCode{
        SUCCESS(200),
        FAILED(500);

        public int code;

        ResultCode(int code) {
            this.code = code;
        }
    }
}
